/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 姚东名
 * Date: 2024-06-19
 * Time: 19:07
 */
//怎么通过方法交换两个数的数值
//错误示范：
public class Main1 {
    public static void Swap(int x, int y) {
        int tmp = x;
        x = y;
        y = tmp;
    }

    public static void main(String[] args) {
        int a = 10;
        int b = 20;
        System.out.println("交换前：" + a + " " + b);
        Swap(a, b);
        System.out.println("交换后：" + a + " " + b);
    }
}
